package com.cyz.user.controller;

import com.cyz.user.userService.ShopService;
import com.cyz.user.userService.ShopTypeService;
import com.cyz.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户端付费课程相关接口")
@RestController
@RequestMapping("/shop")
public class ShopController {

    @Autowired
    private ShopTypeService shopTypeService;
    @Autowired
    private ShopService shopService;

    @ApiOperation(value = "查询付费课程分类")
    @GetMapping("/queryShopTypes")
    public R queryShopTypes(){
        return shopTypeService.queryShopTypes();
    }

    @ApiOperation(value = "查询付费课程")
    @GetMapping("/queryShops")
    public R queryShops(){
        return shopService.queryShops();
    }

    @ApiOperation(value = "根据id查询付费课程")
    @GetMapping("/getShopById")
    public R getShopById(String id){
        return shopService.getShopById(id);
    }
}
